import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/closure/close_in_and_out_entity.dart';

CloseInAndOutEntity $CloseInAndOutEntityFromJson(Map<String, dynamic> json) {
  final CloseInAndOutEntity closeInAndOutEntity = CloseInAndOutEntity();
  final int? advance = jsonConvert.convert<int>(json['advance']);
  if (advance != null) {
    closeInAndOutEntity.advance = advance;
  }
  final String? dateTime = jsonConvert.convert<String>(json['dateTime']);
  if (dateTime != null) {
    closeInAndOutEntity.dateTime = dateTime;
  }
  final int? goOut = jsonConvert.convert<int>(json['goOut']);
  if (goOut != null) {
    closeInAndOutEntity.goOut = goOut;
  }
  final int? whiteAdvance = jsonConvert.convert<int>(json['whiteAdvance']);
  if (whiteAdvance != null) {
    closeInAndOutEntity.whiteAdvance = whiteAdvance;
  }
  final int? whiteGoOut = jsonConvert.convert<int>(json['whiteGoOut']);
  if (whiteGoOut != null) {
    closeInAndOutEntity.whiteGoOut = whiteGoOut;
  }
  return closeInAndOutEntity;
}

Map<String, dynamic> $CloseInAndOutEntityToJson(CloseInAndOutEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['advance'] = entity.advance;
  data['dateTime'] = entity.dateTime;
  data['goOut'] = entity.goOut;
  data['whiteAdvance'] = entity.whiteAdvance;
  data['whiteGoOut'] = entity.whiteGoOut;
  return data;
}

extension CloseInAndOutEntityExtension on CloseInAndOutEntity {
  CloseInAndOutEntity copyWith({
    int? advance,
    String? dateTime,
    int? goOut,
    int? whiteAdvance,
    int? whiteGoOut,
  }) {
    return CloseInAndOutEntity()
      ..advance = advance ?? this.advance
      ..dateTime = dateTime ?? this.dateTime
      ..goOut = goOut ?? this.goOut
      ..whiteAdvance = whiteAdvance ?? this.whiteAdvance
      ..whiteGoOut = whiteGoOut ?? this.whiteGoOut;
  }
}
